/**
 * @(#) NoticeFacade.as
 *
 * @date		2009. 02. 26.
 * @version		1.0
 * @author		Shin, Yunwoo
 * @description	module facade (공지사항)
 * 				mvc간 주고 받는 메세지를 정의하고,  command를 등록한다.
 */
package com.skt.common_hr.congcon
{
	import com.skt.common_hr.common.puremvc.CommonFacade;
	import com.skt.common_hr.congcon.controller.StartupCommand;

	import flash.display.DisplayObject;

	public class CongconFacade extends CommonFacade
	{
		public static const STARTUP:String 							= 'startup';
		public static const CLOSE_MODULE:String						= 'closeModule';


		public static const LOAD_NOTICE_COMPLETE:String				= "loadNoticeComplete";
		public static const LOAD_NOTICE_FAILED:String				= "loadNoticeFailed";
		public static const INSERT_NOTICE_COMPLETE:String			= "InsertNoticeComplete";
		public static const INSERT_NOTICE_FAILED:String				= "InsertNoticeFailed";
		public static const UPDATE_NOTICE_COMPLETE:String			= "UpdateNoticeComplete";
		public static const UPDATE_NOTICE_FAILED:String				= "UpdateNoticeFailed";
		public static const LOAD_KEY_COMPLETE:String				= "loadKeyComplete";
		public static const LOAD_KEY_FAILED:String					= "loadKeyFailed";
		public static const UPDATE_COUNT_COMPLETE:String			= "updateCountComplete";
		public static const UPDATE_COUNT_FAILED:String				= "updateCountFailed";
		public static const MODE_LIST_NOTICE:String					= "modeListNotice";
		public static const MODE_VIEW_NOTICE:String					= "modeViewNotice";
		public static const MODE_WRITE_NOTICE:String				= "modeWriteNotice";
		public static const MODE_MODIFY_NOTICE:String				= "modeModifyNotice";

		public static const FILE_UPLOAD_FILENAME:String				= "FILE_UPLOAD_FILENAME";


		public function CongconFacade( key:String )
		{
			super(key);
		}

        /**
         * Singleton ApplicationFacade Factory Method
         */
        public static function getInstance( key:String ) : CongconFacade
        {
            if ( instanceMap[ key ] == null ) instanceMap[ key ] = new CongconFacade( key );
            return instanceMap[ key ] as CongconFacade;
        }

        /**
         * Register Commands with the Controller
         *     - parent 클래스의 생성자에서 자동으로 호출됨
         */
        override protected function initializeController( ) : void {
            super.initializeController();
            registerCommand( STARTUP, StartupCommand);
        }

        /**
         * Module의 시작점으로 Certificate.mxml의 creationComplete 이벤트에서 호출한다.
         *
         */
        public function startup(app:Object) :void
        {
        	this.app = app as DisplayObject;
            sendNotification( STARTUP, app );
        }

	}
}